{% extends 'user_home/user.html' %}

{% block title %}
    <title>admin</title>
{% endblock %}

{% block extcss %}
    {{ super() }}
    <link rel="stylesheet" href="../static/css/admin/admin.css">
{% endblock %}

{% block head %}
	<div class="head w">
        <div class="nav w">
            <div class="logo">
                <h2><a href="/index/">职工工资管理系统</a></h2>
            </div>
            <div class="login">
                <ul>
                {% if admin %}
                    <li><a href="#">{{ admin }}</a></li>
                    <li><a href="/admin/logout/">退出登录</a></li>
                {% else %}
                    <li><a href="/login/">登录</a></li>
                    <li><a href="/register/">注册</a></li>
                {% endif %}
                </ul>
            </div>
        </div>
    </div>
{% endblock %}

{% block body %}
    <div class="box1 clearfix">
        <div class="box2">
            <ul>
                <li><a href="/admin/">部门管理</a></li>
                <li><a href="/admin_job/">职位管理</a></li>
                <li><a href="/admin_staff/">人员管理</a></li>
                <li><a href="#">工资管理</a></li>
            </ul>
        </div>
        <div class="box3">
        {% block one %}
        <form action="/admin/" method="post">
            <table class="table">
                    <thead>
                        <tr>
                            <th>id</th>
                            <th>部门</th>
                            <th>基础薪资</th>
                            <th>修改</th>
                        </tr>
                    </thead>
                    <tbody>
                    {% for department in departments %}
                        <tr>
                            <td>{{ department.id }}</td>
                            <td><input type="text" name="{{ department.name }}" value="{{ department.name }}"></td>
                            <td><input type="text" name="{{ department.wages }}" value="{{ department.wages }}"></td>
                            <td><input type="submit" name="{{ department.id }}" value="修改"></td>
                        </tr>
                    {% endfor %}
                        <tr>
                            <td>自增</td>
                            <td><input type="text" name="add_name" value=""></td>
                            <td><input type="text" name="add_wages" value=""></td>
                            <td><input type="submit" name="add" value="添加"></td>
                        </tr>
                    </tbody>
            </table>
        </form>
        {% endblock %}
            <div class="box4">
                <ul>
                    {% block twe %}
                    {% if p.page > 1 %}
                    	<li><a href="{{ p.page - 1 }}">上一页</a></li>
                        {% else %}
                        <li><a href="">上一页</a></li>
                    {% endif %}
                    <li><a href="#"></a>{{ p.page }}</li>
                    {% if p.pages > p.page %}
                    	<li><a href="{{ p.page + 1 }}">下一页</a></li>
                    {% else %}
                        <li><a href="">下一页</a></li>
                    {% endif %}
                    {% endblock %}
                </ul>
            </div>
        </div>
    </div>
{% endblock %}